package com.zh.freechat.assemble;


import com.zh.freechat.common.resp.ChatRelationDTO;
import com.zh.freechat.common.resp.ChatRelationVO;
import com.zh.freechat.domain.user.entity.ChatUser;
import org.springframework.beans.BeanUtils;

/**
 * @Author ZH
 * @Date 18:47 2020/7/18
 */
public final class ChatRelationWrapper {

    public static ChatRelationVO convertVO(ChatRelationDTO dto) {
        ChatRelationVO vo = new ChatRelationVO();
        BeanUtils.copyProperties(dto,vo);

        ChatUser chatUser = dto.getChatUser();
        vo.setChatUser(ChatUserWrapper.convertVO(chatUser));
        vo.setUserId(dto.getUserId());
        return vo;
    }
}
